| Conditions | 2 |
| Total Lines | 26 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { HttpService } from '@nestjs/axios'; |
||
| 43 | |||
| 44 | public async createReaction( |
||
| 45 | postId: string, |
||
| 46 | emojiName: string |
||
| 47 | ): Promise<object> { |
||
| 48 | // ded6nfbsejdp7cj4mkwyeknuna |
||
| 49 | try { |
||
| 50 | const response = await this.httpService.axiosRef.post( |
||
| 51 | `${this.configService.get<string>('MATTERMOST_API_URL')}/reactions`, |
||
| 52 | { |
||
| 53 | post_id: postId, |
||
| 54 | emoji_name: emojiName, |
||
| 55 | user_id: this.configService.get<string>('MATTERMOST_ALFRED_USER_ID') |
||
| 56 | }, |
||
| 57 | { |
||
| 58 | headers: { |
||
| 59 | Authorization: `Bearer ${this.configService.get<string>( |
||
| 60 | 'MATTERMOST_ALFRED_TOKEN' |
||
| 61 | )}` |
||
| 62 | } |
||
| 63 | } |
||
| 64 | ); |
||
| 65 | |||
| 66 | return response.data; |
||
| 67 | } catch (e) { |
||
| 68 | throw BadGatewayException; |
||
| 69 | } |
||
| 72 |